package cn.oveay.classdesign.bean.basebean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Subject implements Serializable {
    //使用常量来定义枚举值
    public static final int SINGLE=1;
    public static final int MULTI=2;
    //使用常量来定义页面上需要显示的那几个值
    public static final String SINGLE_NAME="单选";
    public static final String MULTI_NAME="多选";
    //使用map键值对集合来定义常量和显示值之间的关系
    public static Map<Integer,String> numberMap = new HashMap<Integer,String>();
    static{
        numberMap.put(SINGLE,SINGLE_NAME);
        numberMap.put(MULTI, MULTI_NAME);
    }

    private String id;
    private String title;
    private Integer number;
    private Long starttime;
    private Long endtime;
    private String userId;

    //导航属性：功能
    private User user;
    //选项的导航属性：
    private List<Option> options;
    //视图值属性：日期，有限的几个值
    //视图值属性一般没有setter访问器
    //给对应的属性赋值时，计算的来
    private String startTimeView;
    private String endTimeView;
    private String numberView;
    private int count;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Long getStarttime() {
        return starttime;
    }

    public void setStarttime(Long starttime) {
        this.starttime = starttime;
    }

    public Long getEndtime() {
        return endtime;
    }

    public void setEndtime(Long endtime) {
        this.endtime = endtime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Subject(String id, String title, Integer number, Long starttime, Long endtime, String userId) {
        user = new User();
        options = new ArrayList<Option>();
        /******************/
        this.id = id;
        this.title = title;
        this.number = number;
        this.starttime = starttime;
        this.endtime = endtime;
        this.userId = userId;
    }

    public Subject() {
        user = new User();
        options = new ArrayList<Option>();
        /******************/
    }

    /********************************************************/
    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<Option> getOptions() {
        return options;
    }

    public void setOptions(List<Option> options) {
        this.options = options;
    }

    public String getStartTimeView() {
        return startTimeView;
    }

    public void setStartTimeView(String startTimeView) {
        this.startTimeView = startTimeView;
    }

    public String getEndTimeView() {
        return endTimeView;
    }

    public void setEndTimeView(String endTimeView) {
        this.endTimeView = endTimeView;
    }

    public String getNumberView() {
        return numberView;
    }

    public void setNumberView(String numberView) {
        this.numberView = numberView;
    }

//    **********************************************************************

    @Override
    public String toString() {
        return "Subject{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", number=" + number +
                ", starttime=" + starttime +
                ", endtime=" + endtime +
                ", userId='" + userId + '\'' +
                ", user=" + user +
                ", options=" + options +
                ", startTimeView='" + startTimeView + '\'' +
                ", endTimeView='" + endTimeView + '\'' +
                ", numberView='" + numberView + '\'' +
                ", count=" + count +
                '}';
    }
}
